import { services } from '@/config'

export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'left',
  searchMenuSpan: 6,
  searchShow: false,
  selection: true,
  menuWidth: 300,
  viewBtn: true,
  viewDisabled: true,
  column: [
    {
      type: 'input',
      label: '问题单号',
      prop: 'number',
      span: 12,
      display: false,
      search: true,
      width: 130,
      order: 1
    },
    {
      type: 'input',
      label: '分类名称',
      prop: 'ctiName',
      formslot: true,
      search: true,
      span: 12,
      width: 90,
      required: true,
      rules: [{ required: true, message: '选择分类名称' }],
      order: 2
    },
    {
      type: 'textarea',
      label: '问题描述',
      prop: 'infor',
      search: true,
      span: 24,
      display: true,
      width: 250,
      order: 5
    },
    {
      type: 'year',
      label: '年度',
      prop: 'year',
      span: 12,
      display: true,
      width: 60,
      format: 'yyyy',
      valueFormat: 'yyyy',
      search: true,
      required: true,
      rules: [{ required: true, message: '年度必须填写' }]
    },
    {
      type: 'select',
      label: '来源',
      prop: 'source',
      allowCreate: true,
      filterable: true,
      dicUrl: `${services.personnelService}infor/getSource`,
      dicMethod: 'post',
      props: { label: 'label', value: 'value' },
      search: true,
      span: 12,
      order: 3
    },
    {
      type: 'date',
      label: '完成时间',
      prop: 'completionDate',
      span: 12,
      display: false,
      hide: true,
      search: false,
      width: 150,
      format: 'yyyy-MM-dd',
      valueFormat: 'yyyy-MM-dd',
      searchRange: true
    },
    {
      type: 'select',
      label: '状态',
      search: true,
      dicData: [
        {
          label: '草稿',
          value: 0
        },
        {
          label: '处理中',
          value: 1
        },
        {
          label: '已完成',
          value: 2
        },
        {
          label: '作废',
          value: '4'
        }
      ],
      span: 12,
      display: true,
      props: {
        label: 'label',
        value: 'value'
      },
      prop: 'status',
      value: 0,
      cascaderItem: [],
      width: 65,
      order: 4
    },
    {
      type: 'select',
      label: '完成情况',
      prop: 'completion',
      search: false,
      span: 24,
      width: 100,
      display: false,
      hide: true,
      props: {
        label: 'label',
        value: 'value'
      },
      dicData: [
        {
          label: '未完成',
          value: '0'
        },
        {
          label: '已整改',
          value: '1'
        },
        {
          label: '进行中',
          value: '2'
        },
        {
          label: '长期坚持',
          value: '3'
        },
        {
          label: '需回头看',
          value: '4'
        }
      ],
      order: 6
    },
    {
      type: 'textarea',
      label: '备注',
      prop: 'remarks',
      span: 24,
      display: true,
      width: 250,
      order: 7,
      html: true
    },
    {
      label: '附件信息',
      prop: 'uploadPage',
      type: 'input',
      formslot: true,
      slot: true,
      span: 24,
      hide: true
    }
  ]
}
